//
//  FKGoodsTimeCell.m
//  WanTao
//
//  Created by Macbook Pro on 2019/4/25.
//  Copyright © 2019 Macbook Pro. All rights reserved.
//

#import "FKGoodsTimeCell.h"

@interface FKGoodsTimeCell ()

@property (nonatomic, weak) UILabel *activeTimeLabel;
@property (nonatomic, weak) UILabel *beginSaleLabel;
//@property (nonatomic, weak) UILabel *endSaleLabel;

@end

@implementation FKGoodsTimeCell

- (void)setupSubviews
{
    [super setupSubviews];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    UILabel *activeTimeLabel = [UILabel fk_labelWithFont:fk_adjustFont(12) textColor:fkMainColor];
    [self.contentView addSubview:activeTimeLabel];
    self.activeTimeLabel = activeTimeLabel;
    
    UILabel *beginSaleLabel = [UILabel fk_labelWithFont:fk_adjustFont(12) textColor:fkMainColor];
    [self.contentView addSubview:beginSaleLabel];
    self.beginSaleLabel = beginSaleLabel;
    
//    UILabel *endSaleLabel = [UILabel fk_labelWithFont:fk_adjustFont(12) textColor:fkMainColor];
//    [self.contentView addSubview:endSaleLabel];
//    self.endSaleLabel = endSaleLabel;
    
    [activeTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(12);
        make.bottom.equalTo(self.contentView.mas_centerY).offset(fk_adjustW(-6));
    }];
    [beginSaleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(activeTimeLabel);
        make.top.equalTo(self.contentView.mas_centerY).offset(fk_adjustW(6));
    }];
//    [endSaleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.right.offset(-12);
//        make.centerY.equalTo(beginSaleLabel);
//    }];
}

- (void)setData:(id)data
{
    [super setData:data];
    
    
    self.activeTimeLabel.text = data[@"activeTime"];
    self.beginSaleLabel.text = data[@"saleTime"];
    
//    self.beginSaleLabel.hidden = false;
//    if ([fkFORMAT(@"%@", data[@"sale_start_status"]) isEqualToString:@"0"]) { // 未开售
//        self.beginSaleLabel.text = fkFORMAT(@"开售时间: %@", [data[@"sale_start_time"] fk_timeWithFormat:@"yyyy-MM-dd HH:mm"]);
//    } else if ([fkFORMAT(@"%@", data[@"sale_start_status"]) isEqualToString:@"1"]) { // 已开售
//        self.beginSaleLabel.text = data[@"sale_start_name"];
//    }
    
//    self.endSaleLabel.text = fkFORMAT(@"开售时间: %@", [data[@"sale_end_time"] fk_timeWithFormat:@"yyyy-MM-dd HH:mm"]);
}

@end
